// 查询 history_results 表，返回所有记录
const getAllHistoryResults = async (pool, history_table_name) => {
  try {
    // 查询所有记录
    const [rows] = await pool.query(`SELECT * FROM ${history_table_name} ORDER BY time ASC`)
    return rows
  } catch (err) {
    console.error('查询历史记录时出错:', err)
    throw err
  }
}

module.exports = { getAllHistoryResults }
